#pragma once

/// <summary>
/// ControllerInput: Responsible for updating input from gamepad
/// <summary>

/**	
  * Author: Dane Bulat
  * Created: 06/2013
  * Last Modified: 30/06/2013
  * Version: v1.0
  */

// Includes
#include <Windows.h>
#include <XInput.h>

// Class Definition
class ControllerInput
{
public:

//==============================
// Constructors / Destructors
//==============================

	/// Default Constructor
	ControllerInput();

	/// Copy Constructor
	ControllerInput(const ControllerInput& rhs);

	/// Default Destructor
	~ControllerInput();

//==============================
// Initialise
//==============================

	/// Initialise the instance
	bool Initialise();

//==============================
// Update
//==============================

	/// Update input values every frame
	void Update();


//==============================
// Thumb Sticks
//==============================

	// Thumb range: -32,768 to 32,767
	
	/// Get X position of left thumb stick.
	float get_thumbLX() const;			

	/// Get Y position of left thumb stick.
	float get_thumbLY() const;			

	/// Get X position of right thumb stick.
	float get_thumbRX() const;			

	/// Get Y position of right thumb stick.
	float get_thumbRY() const;			


//==============================
// Triggers
//==============================

	// Trigger range: 0 - 255

	/// Get left trigger value.
	float get_leftTrigger() const;		

	/// Get right trigger value.
	float get_rightTrigger() const;		

//==============================
// Shoulder Buttons
//==============================

	/// Get left shoulder button.
	bool get_leftShoulder() const;		

	/// Get right shoulder button.
	bool get_rightShoulder() const;		

//==============================
// X and Z Buttons
//==============================

	/// Get A button.
	bool get_buttonA() const;			

	/// Get X button. 
	bool get_buttonX() const;			

private:
	XINPUT_STATE m_controller_state;		///< Current State of the input device

	XINPUT_STATE m_prev_controller_state;   ///< Previous State of the input device
};